package com.itheima.controller;

import com.itheima.doman.Result;
import com.itheima.doman.pojo.ClazzOption;
import com.itheima.doman.pojo.JobOption;
import com.itheima.service.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    @GetMapping("/empJobData")
    public Result reportEmpData(){
        JobOption jobOption = reportService.reportEmpData();
        return Result.success(jobOption);
    }
    @GetMapping("/empGenderData")
    public Result reportEmpGenderData(){
        List<Map> list = reportService.countEmpGender();
        return Result.success(list);
    }
    @GetMapping("/studentDegreeData")
    public Result reportStudentDegreeData(){
        List<Map> list = reportService.countStudentDegree();
        return Result.success(list);
    }
    @GetMapping("/studentCountData")
    public Result reportStudentCountData(){
        ClazzOption clazzOption = reportService.countStudentData();
        return Result.success(clazzOption);
    }
}
